Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit test for Paste source from M365 Apps #1918

Merged
merged 10 commits into from
Jun 30, 2023

Conversation

BryanValverdeU
Copy link
Contributor

Add unit test using clipboard data from M365 Apps.

editor.paste(clipboardData);

expect(editor.getContent()).toEqual(
Browser.isFirefox
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Firefox can generate different HTML than others?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about it. I think that is how Firefox handles the HTML. It seems they add family name style to paragraph element. That is the only difference I see.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also verify the content model inside? Then we may understand why they are different

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the content model tests to the new package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just going to check whether the function that process the content was called.
We already have other unit tests to make sure the content is sanitized correctly. These unit tests will just make sure we do not break the logic to call the function.

@BryanValverdeU BryanValverdeU marked this pull request as draft June 28, 2023 01:08
@BryanValverdeU BryanValverdeU marked this pull request as ready for review June 30, 2023 01:56
@BryanValverdeU BryanValverdeU merged commit 9807ed1 into master Jun 30, 2023
@JiuqingSong JiuqingSong deleted the u/bvalverde/addUnitTest branch September 8, 2023 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants